import Vue from 'vue'
import VueRouter from 'vue-router'
import BodyList from '../views/BodyList.vue'
import CreateEdit from '../views/createEdit.vue'
import Edit from '../views/Edit.vue'

Vue.use(VueRouter)

const routes = [
   {
     path:'/',
     name:'home',
     redirect:'/articles/index'
   },
   {
     path:'/articles/index',
     name:'body-list',
     component:BodyList
   },
   {
    path:'/articles/create',
    name:'create-edit',
    component:CreateEdit
  },
  {
    path:'/articles/:id/edit',
    name:'Edit',
    component:Edit
  }
]

const router = new VueRouter({
  routes
})

export default router
